package com.wang.controller;

import com.aaa.entity.BAppeal;
import com.aaa.entity.BBusinessInfo;
import com.aaa.vo.FormData;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wang.service.BAppealService;
import com.wang.service.BBusinessInfoService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :  DongZheng Wang
 * @PROJECT_NAME: fifth-cai-parent
 * @date :  2023-02-27 10:27
 **/
@RestController
@RequestMapping("/business")
public class BAppealMapperController {
    @Autowired
    private BBusinessInfoService bBusinessInfoService;
   @RequestMapping("/loadingshop")
    public Result page1(Integer currentPage, Integer pageSize, @RequestBody FormData formData){
    Page<BBusinessInfo> pageinfo=new Page(currentPage,pageSize);
    LambdaQueryWrapper<BBusinessInfo> wrapper=new LambdaQueryWrapper();
    wrapper.like(StringUtils.isNotEmpty(formData.getStatus()),BBusinessInfo::getStatus,formData.getStatus());
       Page page3 = bBusinessInfoService.page(pageinfo, wrapper);
       return new Result(2000,"success",page3);

}
}
